From: NeilBrown Date: Sat, 3 Oct 2020 10:34:54 +0000 (+1000) Subject: Re-indent code messed up by name-change. X-Git-Tag: v1.3~2 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=a380374f5cb920033ccb999e3fac231fd3b7bfbc;p=wiggle.git Re-indent code messed up by name-change. Previous patch made some names longer which messed up some indenting alignment. So re-indent things to look better. Signed-off-by: NeilBrown --- diff --git a/bestmatch.c b/bestmatch.c index 6d1bcbd..df872d4 100644 --- a/bestmatch.c +++ b/bestmatch.c @@ -245,8 +245,8 @@ static void find_best(struct file *a, struct file *b, (y > bhi || (best_val(&v[klo], min(ahi-x, bhi-y)) < best[v[klo].c].val && best_val(&v[klo+1], min(ahi-x, bhi-y+1)) < best[v[klo+1].c].val - ) - )) { + ) + )) { klo += 2; x = (klo+f)/2; y = x-klo; } @@ -260,8 +260,8 @@ static void find_best(struct file *a, struct file *b, (v[khi].c >= 0 && best_val(&v[khi], min(ahi-x, bhi-y)) < best[v[khi].c].val && best_val(&v[khi-1], min(ahi-x+1, bhi-y)) < best[v[khi].c].val - ) - )) { + ) + )) { khi -= 2; x = (khi+f)/2; y = x - khi; } @@ -478,8 +478,8 @@ struct csl *wiggle_pdiff(struct file a, struct file b, int chunks) while (xlo > xmin && !ends_line(a.list[xlo-1])) xlo--; csl2 = wiggle_diff_partial(a, b, - xlo, best[i].xlo, - ylo, best[i].ylo); + xlo, best[i].xlo, + ylo, best[i].ylo); csl1 = wiggle_csl_join(csl1, csl2); } @@ -487,8 +487,8 @@ struct csl *wiggle_pdiff(struct file a, struct file b, int chunks) * good match */ csl2 = wiggle_diff_partial(a, b, - best[i].xlo, best[i].xhi, - best[i].ylo, best[i].yhi); + best[i].xlo, best[i].xhi, + best[i].ylo, best[i].yhi); csl1 = wiggle_csl_join(csl1, csl2); /* Now if there are newlines at the end of the @@ -512,8 +512,8 @@ struct csl *wiggle_pdiff(struct file a, struct file b, int chunks) xhi++; } csl2 = wiggle_diff_partial(a, b, - best[i].xhi, xhi, - best[i].yhi, yhi); + best[i].xhi, xhi, + best[i].yhi, yhi); csl1 = wiggle_csl_join(csl1, csl2); xmin = xhi; } diff --git a/diff.c b/diff.c index 2772b21..951dd9f 100644 --- a/diff.c +++ b/diff.c @@ -686,7 +686,7 @@ struct csl *wiggle_diff(struct file a, struct file b, int shortest) * subranges of files. */ struct csl *wiggle_diff_partial(struct file a, struct file b, - int alo, int ahi, int blo, int bhi) + int alo, int ahi, int blo, int bhi) { struct v *v; struct cslb cslb = {}; diff --git a/extract.c b/extract.c index feaafd4..9a60fc9 100644 --- a/extract.c +++ b/extract.c @@ -225,7 +225,8 @@ int wiggle_split_patch(struct stream f, struct stream *f1, struct stream *f2) /* * extract parts of a "diff3 -m" or "wiggle -m" output */ -int wiggle_split_merge(struct stream f, struct stream *f1, struct stream *f2, struct stream *f3) +int wiggle_split_merge(struct stream f, struct stream *f1, struct stream *f2, + struct stream *f3) { int state = 0; char *cp, *end; diff --git a/merge2.c b/merge2.c index 98b04b6..448d73c 100644 --- a/merge2.c +++ b/merge2.c @@ -90,9 +90,9 @@ static int is_cutpoint(struct merge m, } int wiggle_isolate_conflicts(struct file af, struct file bf, struct file cf, - struct csl *csl1, struct csl *csl2, int words, - struct merge *m, int show_wiggles, - int *wigglesp) + struct csl *csl1, struct csl *csl2, int words, + struct merge *m, int show_wiggles, + int *wigglesp) { /* A Conflict indicates that something is definitely wrong * and so we need to be a bit suspicious of nearby apparent matches. @@ -427,8 +427,8 @@ int wiggle_isolate_conflicts(struct file af, struct file bf, struct file cf, } struct ci wiggle_make_merger(struct file af, struct file bf, struct file cf, - struct csl *csl1, struct csl *csl2, int words, - int ignore_already, int show_wiggles) + struct csl *csl1, struct csl *csl2, int words, + int ignore_already, int show_wiggles) { /* find the wiggles and conflicts between csl1 and csl2 */ @@ -613,7 +613,7 @@ struct ci wiggle_make_merger(struct file af, struct file bf, struct file cf, rv.merger[i].type = Conflict; } rv.conflicts = wiggle_isolate_conflicts(af, bf, cf, csl1, csl2, words, - rv.merger, show_wiggles, &rv.wiggles); + rv.merger, show_wiggles, &rv.wiggles); return rv; } @@ -638,8 +638,8 @@ static const char *conflict_types[] = { "", " border"," conflict"," wiggle" }; int wiggle_print_merge(FILE *out, struct file *a, struct file *b, struct file *c, - int words, struct merge *merger, - struct merge *mpos, int streampos, int offsetpos) + int words, struct merge *merger, + struct merge *mpos, int streampos, int offsetpos) { struct merge *m; int lineno = 1; @@ -786,9 +786,9 @@ int wiggle_print_merge(FILE *out, struct file *a, struct file *b, struct file *c /* Nothing more to report */ break; if (cm->in_conflict == 1 && - (cm->type == Extraneous || - cm->type == Unmatched || - cm->type == Unchanged)) + (cm->type == Extraneous || + cm->type == Unmatched || + cm->type == Unchanged)) /* border between conflicts, but * still nothing to report. */ diff --git a/vpatch.c b/vpatch.c index 5bd8f52..23ba128 100644 --- a/vpatch.c +++ b/vpatch.c @@ -2625,7 +2625,7 @@ static int save_one(FILE *f, struct plist *pl, int reverse, struct ci ci; int chunks; sp = wiggle_load_segment(f, pl->start, - pl->end); + pl->end); if (reverse) chunks = wiggle_split_patch(sp, &sa, &sb); else @@ -3155,7 +3155,7 @@ int vpatch(int argc, char *argv[], int patch, int strip, } pl = wiggle_sort_patches(pl, &num_patches); main_window(pl, num_patches, in, reverse, replace, ignore_blanks, - just_diff, backup); + just_diff, backup); wiggle_plist_free(pl, num_patches); fclose(in); break; @@ -3175,10 +3175,10 @@ int vpatch(int argc, char *argv[], int patch, int strip, } pl = wiggle_sort_patches(pl, &num_patches); main_window(pl, num_patches, f, reverse, replace, - ignore_blanks, just_diff, backup); + ignore_blanks, just_diff, backup); wiggle_plist_free(pl, num_patches); } else if (strlen(argv[0]) > 4 && - strcmp(argv[0]+strlen(argv[0])-4, ".rej") == 0) { + strcmp(argv[0]+strlen(argv[0])-4, ".rej") == 0) { char *origname = strdup(argv[0]); origname[strlen(origname) - 4] = '\0'; show_merge(origname, f, reverse, 0, NULL, NULL, diff --git a/wiggle.c b/wiggle.c index c529486..712e7fe 100644 --- a/wiggle.c +++ b/wiggle.c @@ -161,7 +161,7 @@ static int do_diff_lines(struct file fl[2], struct csl *csl) if (fl[0].list[a].start[0]) { printf("-"); wiggle_printword(stdout, - fl[0].list[a]); + fl[0].list[a]); } a++; exit_status = 1; @@ -169,7 +169,7 @@ static int do_diff_lines(struct file fl[2], struct csl *csl) if (fl[1].list[b].start[0]) { printf("+"); wiggle_printword(stdout, - fl[1].list[b]); + fl[1].list[b]); } b++; exit_status = 1; @@ -180,7 +180,7 @@ static int do_diff_lines(struct file fl[2], struct csl *csl) else { printf(" "); wiggle_printword(stdout, - fl[0].list[a]); + fl[0].list[a]); } a++; b++; @@ -358,11 +358,11 @@ static int do_diff(int argc, char *argv[], int obj, int ispatch, if (which == '2') chunks2 = chunks3 = wiggle_split_patch(f, &flist[2], - &flist[1]); + &flist[1]); else chunks2 = chunks3 = wiggle_split_patch(f, &flist[1], - &flist[2]); + &flist[2]); } else flist[1] = wiggle_load_file(argv[1]); diff --git a/wiggle.h b/wiggle.h index 2757e7a..fa588ed 100644 --- a/wiggle.h +++ b/wiggle.h @@ -145,18 +145,18 @@ extern struct plist *wiggle_sort_patches(struct plist *pl, int *np); extern void wiggle_plist_free(struct plist *pl, int num); extern struct plist *wiggle_parse_patch(FILE *f, FILE *of, int *np); extern struct stream wiggle_load_segment(FILE *f, unsigned int start, - unsigned int end); + unsigned int end); extern int wiggle_set_prefix(struct plist *pl, int n, int strip); extern struct stream wiggle_load_file(char *name); extern int wiggle_split_patch(struct stream, struct stream*, struct stream*); extern int wiggle_split_merge(struct stream, struct stream*, struct stream*, - struct stream*); + struct stream*); extern struct file wiggle_split_stream(struct stream s, int type); extern struct csl *wiggle_pdiff(struct file a, struct file b, int chunks); extern struct csl *wiggle_diff(struct file a, struct file b, int shortest); extern struct csl *wiggle_diff_patch(struct file a, struct file b, int shortest); extern struct csl *wiggle_diff_partial(struct file a, struct file b, - int alo, int ahi, int blo, int bhi); + int alo, int ahi, int blo, int bhi); extern struct csl *worddiff(struct stream f1, struct stream f2, struct file *fl1p, struct file *fl2p); extern struct csl *wiggle_csl_join(struct csl *c1, struct csl *c2);